package com.hello.sky.exception;


import com.hello.sky.enmu.CommonError;

public class SkyException extends RuntimeException{

    private String message;

    public SkyException() {
        super();
    }

    public SkyException(String message) {
        super(message);
        this.message = message;
    }

    public String getErrorMessage(){
        return this.message;
    }

    public static SkyException cast(String message){
        throw  new SkyException(message);
    }

    public static SkyException cast(CommonError commonError){
        throw  new SkyException(commonError.getMessage());
    }

}
